Virtual machines (VMs) consume memory and other hardware resources, which are allocated to a VM when the virtual machine is powered on. Powering on a VM includes a number of steps, all of which are to be completed before the VM is considered to have been powered on. As part of the power-on process, a sufficient amount of memory may be allocated to the VM such that the VM will not be terminated due to an insufficient memory reservation in hardware. A sufficient memory reservation may include both a reservation of physical random access memory (RAM) and swap space on a persistent storage device, such as a hard disk drive or a solid state drive.
Memory allocation may utilize a “thick swap” strategy, in which a hypervisor creates a swap space with an initial size equal to a minimum amount of the virtual memory space to be backed by physical memory (RAM and/or persistent storage) and grows the swap space to the virtual memory space size before declaring that a VM has been powered on. If the hypervisor fails to create the swap space and grow the swap space to the virtual memory space size (which may not occur for many minutes), the hypervisor can declare that the VM has failed to boot and release any resources acquired during the power-on operations. Using a thick swap strategy, storage blocks to be swapped into and out of a memory space are guaranteed while the VM operates. In another strategy, known as a “thin swap” strategy, a hypervisor creates a swap space with an initial size equal to a minimum amount of the virtual memory space to be backed by physical memory and declares that a VM has been powered on. In some cases, the hypervisor may fail to acquire storage blocks when memory pages are swapped into the swap space. When such a failure occurs, operation of a VM may be abruptly terminated. While a “thin swap” strategy may result in a VM being powered on more rapidly, a “thin swap” strategy may not provide for reliable operation of a VM.